package hello;

public class MyThread extends Thread {
    public void run(){
        for (int i = 0; i < 100; i++) {
            if (i % 2 == 0) {
                System.out.println("name"+Thread.currentThread().getName() + ":"+i);
                System.out.println("id"+Thread.currentThread().getId()+":"+i);
                System.out.println("设置线程等级"+Thread.currentThread().getPriority());
                System.out.println("活动线程数"+Thread.activeCount());
            }
        }
    }

    public static void main(String[] args) {
        MyThread myThread = new MyThread();
        myThread.start();
    }
}
